Socket
Socket
Sign inDemoInstall

@brajkowski/connect4-multiplayer-common

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brajkowski/connect4-multiplayer-common

This library provides shared objects used by both the connect 4 multiplayer client and server.


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Connect 4 Multiplayer: Common

Build npm:latest npm:beta semantic-release

This library defines the packet interfaces and actions used by both the connect 4 multiplayer client and server.

Installation

Using npm:

$ npm i --save @brajkowski/connect4-multiplayer-common

Usage

Packet Interfaces

  • server => client packets adhere to the ServerPacket interface
  • client => server packets adhere to the ClientPacket interface

Action Values and Meaning

Both the client and the server send an action value in their respective packet payloads in order to trigger, and respond to, events:

ServerAction ValuesDescription
0The client action is not allowed.
1An opponent has joined the session.
2An opponent has placed a chip.
3A new session has been created.
4The client has joined a session.
5The session the client is trying to reach does not exist.
6The opponent has quit (graceful exit).
7The game has finished and a new one is starting.
8The session has ended (due to inactivity).
ClientAction ValuesDescription
0The client is requesting a new session to be created.
1The client is requesting to join an existing session.
2The client is requesting to place a chip at a location.
3The client is gracefully quitting / leaving the session.

Building from Source

Using npm:

$ npm run build

will produce the compiled library under /dist.

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc